package com.shujia.controller;

import com.shujia.dao.DeptServiceImpl;
import com.shujia.entity.Dept;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@Controller
public class DeptHtmlController {

    //声明日志成员
    private static final Logger log = LoggerFactory.getLogger(DeptController.class);

    @Autowired
    private DeptServiceImpl deptService;

    /**
     * 获取所有部门信息
     * @return
     */
    //http://localhost:8083/bigdata17-pro/dept/all
    @RequestMapping(value = "/alldepts",method = RequestMethod.GET)
    public String getAllCusBaseInfo(Model model){
        log.info("=================数加科技=================");
        List<Dept> allDeptInfo = deptService.getAllCusBaseInfo();
        model.addAttribute("deptss",allDeptInfo);

        return "index3";
    }
}
